import request from '@/utils/request'

// 查询售前工资管理列表
export function listPreSalary(query) {
  return request({
    url: '/operations/preSalary/list',
    method: 'get',
    params: query
  })
}

// 查询售前工资管理详细
export function getPreSalary(id) {
  return request({
    url: '/operations/preSalary/' + id,
    method: 'get'
  })
}

// 新增售前工资管理
export function addPreSalary(data) {
  return request({
    url: '/operations/preSalary',
    method: 'post',
    data: data
  })
}

// 修改售前工资管理
export function updatePreSalary(data) {
  return request({
    url: '/operations/preSalary',
    method: 'put',
    data: data
  })
}

// 删除售前工资管理
export function delPreSalary(id) {
  return request({
    url: '/operations/preSalary/' + id,
    method: 'delete'
  })
}

// 手动触发创建当月工资记录
export function createMonthlySalaryRecords() {
  return request({
    url: '/operations/preSalary/createMonthlySalaryRecords',
    method: 'post'
  })
}